// LCD functions
#define CMD_CLEAR 0xA0
#define CMD_PRINT 0xA1
#define CMD_HOME 0xA2
#define CMD_CURSOR 0xA3
#define CMD_WRITE 0xA4
#define CMD_CURSORMODE 0xA5
#define CMD_BLINKMODE 0xA6
#define CMD_DISPLAYMODE 0xA7
#define CMD_SCROLL 0xA8
#define CMD_AUTOSCROLL 0xA9
#define CMD_TEXTDIRECTION 0xAA
#define CMD_CUSTOMCHAR 0xAB
#define CMD_SETUP 0xAC
#define CMD_PRINTNUMBER 0xAD

#define CMD_SETSCREEN 0xB0
#define CMD_RENDERBIGNUMBER 0xB1
#define CMD_CLEARBIGNUMBER 0xB2

#define CMD_SDINIT 0xC0
#define CMD_SDSIZE 0xC1
#define CMD_READBLOCK 0xC2
#define CMD_READCID 0xC3
#define CMD_SDTYPE 0xC4
#define CMD_READSTART 0xC5
#define CMD_READSTOP 0xC6
#define CMD_READDATA 0xC7
#define CMD_WRITEBLOCK 0xC8
#define CMD_WRITESTART 0xC9
#define CMD_WRITESTOP 0xCA
#define CMD_WRITEDATA 0xCB
#define CMD_SETSCKRATE 0xCC
#define CMD_ERASE 0xCD
#define CMD_ERASESINGLEBLOCKENABLE 0xCE
#define CMD_SDERROR 0xD0
#define CMD_SDERRORCODE 0xD1
#define CMD_SDERRORDATA 0xD2

#define CMD_LOGOPEN 0xE0
#define CMD_LOGNEW 0xE1
#define CMD_LOGCLOSE 0xE2
#define CMD_LOGCLEAR 0xE3
#define CMD_LOGWRITE 0xE4

// controller interrupt commands
#define CMD_STARTUP 0xF0
#define CMD_SHUTDOWN 0xF1
#define CMD_GETFREEBUFFER 0xF2
#define CMD_GETDATA 0xF5
#define CMD_FILEOPEN 0xF6
#define CMD_FILECLOSE 0xF7
#define CMD_FILEREADLINE 0xF8
#define CMD_FILESEEK 0xF9
#define CMD_FILEEXISTS 0xFA
#define CMD_FILESIZE 0xFB
#define CMD_GETERROR 0xFC

#define CMD_ESC 0x00
#define CMD_ENDINTURRPTCOMMAND 0xFE
#define CMD_ENDBUFFERECOMMAND 0xFF

#define ERR_NONE 0x0
#define ERR_PARTIALREAD 0x1
#define ERR_EOF 0x2
#define ERR_OVERFLOW 0x3
